//
//  UIFont+PKFix.swift
//  GoAbroad
//
//  Created by Pink Snow on 2025/5/13.
//


import UIKit
extension UIFont {
    static func adaptedWightFont(size: CGFloat, weight: UIFont.Weight = .regular) -> UIFont {
        let screenWidth = UIScreen.main.bounds.width
        let baseWidth: CGFloat = 393
        let scale = screenWidth / baseWidth
        let adaptedSize = size * scale
        return UIFont.systemFont(ofSize: adaptedSize, weight: weight)
    }
    static func adaptedBoldFont(size: CGFloat) -> UIFont {
        let screenWidth = UIScreen.main.bounds.width
        let baseWidth: CGFloat = 393
        let scale = screenWidth / baseWidth
        let adaptedSize = size * scale
        return UIFont.boldSystemFont(ofSize: adaptedSize)
    }
    static func adaptedSystemFont(size: CGFloat) -> UIFont {
        let screenWidth = UIScreen.main.bounds.width
        let baseWidth: CGFloat = 393
        let scale = screenWidth / baseWidth
        let adaptedSize = size * scale
        return UIFont.systemFont(ofSize: adaptedSize)
    }
    
}
